<template>
    <div class="input-signal file-info">
        <pui-dialog :maskClick="false" :title="props.title" v-model="componentRef.dialogVisible" :animate="props.animate" isFooter @onCancel="closeDialog">
            <template #content>
                <div class="form">
                    <div class="form-item">
                        <div class="label">信号功率:</div>
                        <input class="pui-input" type="text" placeholder="请输入" v-model="componentRef.signal.signalPower"/>
                    </div>
                    <div class="form-item">
                        <div class="label">消光比:</div>
                        <input class="pui-input" type="text" placeholder="请输入" v-model="componentRef.signal.extinctionRatio"/>
                    </div>
                    <div class="form-item">
                        <div class="label">比特率:</div>
                        <input class="pui-input" type="text" placeholder="请输入" v-model="componentRef.signal.bitRate"/>
                    </div>
                    <!-- <div class="form-item">
                        <div class="label">耦合参数:</div>
                        <input class="pui-input" type="text" placeholder="请输入" v-model="componentRef.signal.couplingParameter"/>
                    </div> -->
                    <div class="form-item">
                        <div class="label">符号率:</div>
                        <input class="pui-input" type="text" placeholder="请输入" v-model="componentRef.signal.signRate"/>
                    </div>
                    <div class="form-item">
                        <div class="label">信号类型:</div>
                        <input class="pui-input" type="text" placeholder="请输入" v-model="componentRef.signal.signalType"/>
                    </div>
                </div>
            </template>
            <template #footer>
                <pui-button @click="submitHandle" type="primary">确定</pui-button>
                <pui-button @click="closeDialog">取消</pui-button>
            </template>
        </pui-dialog>
    </div>
</template>
<script lang="ts">
import { defineComponent } from 'vue'
export default defineComponent({
    name: 'InputSignal'
})
</script>
<script lang="ts" setup>
import { reactive, getCurrentInstance, watch } from 'vue'
const { proxy } = getCurrentInstance() as any
const props = defineProps({
    title: {
        type: String,
        default: '系统材料变量-输入信号'
    },
    animate: {
        type: String,
        default: 'fade'
    }
})
const emit = defineEmits({
    onClose: (val: any) => {}
})
const componentRef = reactive({
    dialogVisible: false,
    signal: {
        signalPower: 0,
        extinctionRatio: 0.9,
        bitRate: 10,
        couplingParameter: 4,
        signRate: 4,
        signalType: 'NRZ',
    },
}) as any
const init = () => {
    componentRef.dialogVisible = true
}
const closeDialog = () => {
    componentRef.dialogVisible = false
    emit('onClose', '关闭')
}
const submitHandle = () => {

}

defineExpose({
    init
})
</script>
<style lang="scss">
@import '../fileControl/fileStyle.scss';
</style>